package troisdimension.client;

public class Point {
    private String id = null;
	private double xA = 0;
	private double yA = 0;
	private double zA = 0;
	private double xAngle0 = 0;
	private double yAngle0 = 0;
	private double zAngle0 = 0;
	public double getxAngle0() {
		return xAngle0;
	}

	public void setxAngle0(double xAngle0) {
		this.xAngle0 = xAngle0;
	}

	public double getyAngle0() {
		return yAngle0;
	}

	public void setyAngle0(double yAngle0) {
		this.yAngle0 = yAngle0;
	}

	public double getzAngle0() {
		return zAngle0;
	}

	public void setzAngle0(double zAngle0) {
		this.zAngle0 = zAngle0;
	}

	private double x2d = 0;
	private double y2d = 0;
	private double profondeur = 0;
	
	private PointCentral ptCentral = null;

	public Point() {
	}

	public Point(double x, double y, double z) {
		this.setXA(x);
		this.setYA(y);
		this.setZA(z);
	}

	public Point(double x, double y, double z, PointCentral ptC) {
		this(x, y, z);
		this.setPtCentral(ptC);
	}

    
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public void setXA(double x) {
		this.xA =  Math.round(x);
	}

	public double getXA() {
		return  xA;
	}

	public void setYA(double y) {
		this.yA =  Math.round(y);
	}

	public double getYA() {
		return yA;
	}

	public void setZA(double z) {
		this.zA =  Math.round(z);
	}

	public double getZA() {
		return zA;
	}

	public double getXAtoInt() {
		return (int) xA;
	}

	public double getYAtoInt() {
		return (int) yA;
	}

	public double getZAtoInt() {
		return (int) zA;
	}

	public PointCentral getPtCentral() {
		return ptCentral;
	}

	public void setPtCentral(PointCentral ptCentral) {
		this.ptCentral = ptCentral;
	}

	public double getxR() {
		return (this.isPointCentral()) ? this.getXA()
				- this.getPtCentral().getxR() : this.getXA();
	}

	public double getyR() {
		return (this.isPointCentral()) ? this.getYA()
				- this.getPtCentral().getyR() : this.getYA();
	}

	public double getzR() {
		return (this.isPointCentral()) ? this.getZA()
				- this.getPtCentral().getzR() : this.getZA();
	}

	public boolean isPointCentral() {
		return (this.getPtCentral() != null) ? true : false;
	}

	public void setX2d(double x2d) {
		this.x2d = x2d;
	}

	public double getX2d() {
		return 500 - x2d;
	}

	public void setY2d(double y2d) {
		this.y2d = y2d;
	}

	public double getY2d() {
		return 300 - y2d;
	}

	public double getProfondeur() {
		return profondeur;
	}

	public void setProfondeur(double profondeur) {
		this.profondeur = profondeur;
	}
	
}
